import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart';
import 'package:get/get.dart';

class ProjectItemCard extends StatelessWidget {
  const ProjectItemCard({Key? key, 
    required this.title, 
    required this.icon, 
    required this.path,
    required this.theme,
    required this.btnColor}) : super(key: key);

  final String title, icon, path;

  final ThemeData theme;

  final Color btnColor;

  @override
  Widget build(BuildContext context) {
    return Container(
      padding: const EdgeInsets.all(10),
      decoration: BoxDecoration(
        color: Colors.white,
        borderRadius: BorderRadius.circular(8),
        boxShadow: [
          BoxShadow(
            offset: const Offset(0, 15),
            blurRadius: 22,
            color: Theme.of(context).primaryColor.withOpacity(.22)
          ),
          const BoxShadow(
            offset: Offset(-15, -15),
            blurRadius: 22,
            color: Colors.white
          )
        ]
      ),
      child: Column(
        mainAxisSize: MainAxisSize.min,
        children: [
          SizedBox(
            width: 105,
            height: 105,
            child: SvgPicture.asset(icon),
          ),
          SizedBox(
            width: 105,
            child: TextButton(
              style: TextButton.styleFrom(
                backgroundColor: btnColor,
                shape: RoundedRectangleBorder(
                  borderRadius: BorderRadius.circular(20)
                )
              ),
              onPressed: () {
                Get.changeTheme(theme);
                Get.toNamed(path);
              }, 
              child: Text(
                title,
                style: const TextStyle(
                  color: Colors.white
                ),
              )
            ),
          )
        ],
      ),
    );
  }
}